import request from "@/utils/request.ts";
import Enum from "@/api/homeApi/enum.ts";
import type { KnowledgePage, KnowledgeParams, PageParams, DoctorList, DoctorPage, FollowType } from "@/types/homeTypes/homeTypes.ts";
import type { ResponseType } from "@/types/commonTypes/commonTypes.ts";

/*获取知识列表的接口*/
export const fetchKnowledgeListAPI = (params: KnowledgeParams) => request.get<KnowledgePage, ResponseType<KnowledgePage>, { params: { params: KnowledgeParams } }>(Enum.fetchKnowledge, { params });
/*获取关注的医生列表*/
export const fetchMedicListAPI = (params: PageParams) => request.get<DoctorList, ResponseType<DoctorPage>, { params: { params: PageParams } }>(Enum.fetchMedicList, { params: params });
/*关注的接口*/
export const followOrUnfollowAPI = (id: string, type: FollowType) => request.post<{ id: string }, ResponseType<{ id: string }>, { id: string, type: FollowType }>(Enum.like, { id, type });
